<!DOCTYPE html>
<html>

<head>
  <title>Quarkus - HTTP Reference</title>
  <script id="adobe_dtm" src="https://www.redhat.com/dtm.js" type="text/javascript"></script>
  <script src="/assets/javascript/highlight.pack.js" type="text/javascript"></script>
  <META HTTP-EQUIV='Content-Security-Policy' CONTENT="default-src 'none'; script-src 'self' 'unsafe-eval' 'sha256-ANpuoVzuSex6VhqpYgsG25OHWVA1I+F6aGU04LoI+5s=' 'sha256-ipy9P/3rZZW06mTLAR0EnXvxSNcnfSDPLDuh3kzbB1w=' js.bizographics.com https://www.redhat.com assets.adobedtm.com jsonip.com https://ajax.googleapis.com https://www.googletagmanager.com https://www.google-analytics.com https://use.fontawesome.com; style-src 'self' https://fonts.googleapis.com https://use.fontawesome.com; img-src 'self' *; media-src 'self' ; frame-src https://www.googletagmanager.com https://www.youtube.com; frame-ancestors 'none'; base-uri 'none'; object-src 'none'; form-action 'none'; font-src 'self' https://use.fontawesome.com https://fonts.gstatic.com;">
  <META HTTP-EQUIV='X-Frame-Options' CONTENT="DENY">
  <META HTTP-EQUIV='X-XSS-Protection' CONTENT="1; mode=block">
  <META HTTP-EQUIV='X-Content-Type-Options' CONTENT="nosniff">
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="Quarkus: Supersonic Subatomic Java">
  <meta name="twitter:card" content="summary_large_image">
  <meta name="twitter:site" content="@QuarkusIO"> 
  <meta name="twitter:creator" content="@QuarkusIO">
  <meta property="og:url" content="https://quarkus.io/guides/http-reference" />
  <meta property="og:title" content="Quarkus - HTTP Reference" />
  <meta property="og:description" content="Quarkus: Supersonic Subatomic Java" />
  <meta property="og:image" content="/assets/images/quarkus_card.png" />
  <link rel="canonical" href="https://quarkus.io/guides/http-reference">
  <link rel="shortcut icon" type="image/png" href="/favicon.ico" >
  <link rel="stylesheet" href="https://quarkus.io/guides/stylesheet/config.css" />
  <link rel="stylesheet" href="/assets/css/main.css" />
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
  <link rel="alternate" type="application/rss+xml"  href="https://quarkus.io/feed.xml" title="Quarkus">
  <script src="https://quarkus.io/assets/javascript/goan.js" type="text/javascript"></script>
  <script src="https://quarkus.io/assets/javascript/hl.js" type="text/javascript"></script>
</head>

<body class="guides">
  <!-- Google Tag Manager (noscript) -->
  <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NJWS5L"
  height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
  <!-- End Google Tag Manager (noscript) -->

  <div class="nav-wrapper">
  <div class="grid-wrapper">
    <div class="width-12-12">
      <input type="checkbox" id="checkbox" />
      <nav id="main-nav" class="main-nav">
  <div class="container">
    <div class="logo-wrapper">
      
        <a href="/"><img src="/assets/images/quarkus_logo_horizontal_rgb_600px_reverse.png" class="project-logo" title="Quarkus"></a>
      
    </div>
    <label class="nav-toggle" for="checkbox">
      <i class="fa fa-bars"></i>
    </label>
    <div id="menu" class="menu">
      <span>
        <a href="/get-started/" class="">Get Started</a>
      </span>
      <span>
        <a href="/guides/" class="active">Guides</a>
      </span>
      <span>
        <a href="/community/" class="">Community</a>
      </span>
      <span>
        <a href="/support/" class="">Support</a>
      </span>
      <span>
        <a href="/blog/" class="">Blog</a>
      </span>
      <span>
        <a href="https://code.quarkus.io" class="button-cta secondary white">Start Coding</a>
      </span>
    </div>
  </div>
      </nav>
    </div>
  </div>
</div>

  <div class="content">
    <div class="guide">
  <div class="width-12-12">
    <h1 class="text-caps">Quarkus - HTTP Reference</h1>
    <div class="hide-mobile toc"><ul class="sectlevel1">
<li><a href="#serving-static-resources">1. Serving Static Resources</a>
<ul class="sectlevel2">
<li><a href="#webjar-locator-support">1.1. WebJar Locator Support</a></li>
</ul>
</li>
<li><a href="#configuring-the-context-path">2. Configuring the Context path</a></li>
<li><a href="#supporting-secure-connections-with-ssl">3. Supporting secure connections with SSL</a>
<ul class="sectlevel2">
<li><a href="#providing-a-certificate-and-key-file">3.1. Providing a certificate and key file</a></li>
<li><a href="#providing-a-keystore">3.2. Providing a keystore</a></li>
<li><a href="#setting-the-password">3.3. Setting the password</a></li>
<li><a href="#disable-the-http-port">3.4. Disable the HTTP port</a></li>
</ul>
</li>
<li><a href="#http2-support">4. HTTP/2 Support</a></li>
<li><a href="#cors-filter">5. CORS filter</a></li>
<li><a href="#http-limits-configuration">6. HTTP Limits Configuration</a></li>
<li><a href="#configuring-http-access-logs">7. Configuring HTTP Access Logs</a></li>
<li><a href="#servlet-config">8. Servlet Config</a>
<ul class="sectlevel2">
<li><a href="#undertow-handlers-conf">8.1. undertow-handlers.conf</a></li>
<li><a href="#web-xml">8.2. web.xml</a></li>
</ul>
</li>
</ul></div>
    <div>
      <div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>This document explains various HTTP features that you can use in Quarkus.</p>
</div>
<div class="paragraph">
<p>HTTP is provided using Eclipse Vert.x as the base HTTP layer. Servlet&#8217;s are supported using a modified version of Undertow that
runs on top of Vert.x, and RESTEasy is used to provide JAX-RS support. If Undertow is present RESTEasy will run as a
Servlet filter, otherwise it will run directly on top of Vert.x with no Servlet involvement.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="serving-static-resources"><a class="anchor" href="#serving-static-resources"></a>1. Serving Static Resources</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To serve static resources you must place them in the <code>META-INF/resources</code> directory of your application. This location
was chosen as it is the standard location for resources in <code>jar</code> files as defined by the Servlet spec. Even though
Quarkus can be used without Servlet following this convention allows existing code that places its resources in this
location to function correctly.</p>
</div>
<div class="sect2">
<h3 id="webjar-locator-support"><a class="anchor" href="#webjar-locator-support"></a>1.1. WebJar Locator Support</h3>
<div class="paragraph">
<p>If you are using webjars, like the following JQuery one</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="xml" class="language-xml hljs">&lt;dependency&gt;
    &lt;groupId&gt;org.webjars&lt;/groupId&gt;
    &lt;artifactId&gt;jquery&lt;/artifactId&gt;
    &lt;version&gt;3.1.1&lt;/version&gt;
&lt;/dependency&gt;</code></pre>
</div>
</div>
<div class="paragraph">
<p>and rather write <code>/webjars/jquery/jquery.min.js</code> instead of <code>/webjars/jquery/3.1.1/jquery.min.js</code>
in your HTML files, you can add the <code>quarkus-webjars-locator</code> extension to your project.
To use it, add the following to your project&#8217;s dependencies:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="xml" class="language-xml hljs">&lt;dependency&gt;
    &lt;groupId&gt;io.quarkus&lt;/groupId&gt;
    &lt;artifactId&gt;quarkus-webjars-locator&lt;/artifactId&gt;
&lt;/dependency&gt;</code></pre>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="configuring-the-context-path"><a class="anchor" href="#configuring-the-context-path"></a>2. Configuring the Context path</h2>
<div class="sectionbody">
<div class="paragraph">
<p>By default Quarkus will serve content from under the root context. If you want to change this you can use the
<code>quarkus.http.root-path</code> config key to set the context path.</p>
</div>
<div class="paragraph">
<p>If you are using Servlet you can control the Servlet context path via <code>quarkus.servlet.context-path</code>. This item is relative
to the http root above, and will only affect Servlet and things that run on top of Servlet. Most applications will
want to use the HTTP root as this affects everything that Quarkus serves.</p>
</div>
<div class="paragraph">
<p>If both are specified then all non-Servlet web endpoints will be relative to <code>quarkus.http.root-path</code>, while Servlet&#8217;s
will be served relative to <code>{quarkus.http.root-path}/{quarkus.servlet.context-path}</code>.</p>
</div>
<div class="paragraph">
<p>If REST Assured is used for testing and <code>quarkus.http.root-path</code> is set then Quarkus will automatically configure the
base URL for use in Quarkus tests, so test URL&#8217;s should not include the root path.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="supporting-secure-connections-with-ssl"><a class="anchor" href="#supporting-secure-connections-with-ssl"></a>3. Supporting secure connections with SSL</h2>
<div class="sectionbody">
<div class="paragraph">
<p>In order to have Quarkus support secure connections, you must either provide a certificate and associated key file, or supply a keystore.</p>
</div>
<div class="paragraph">
<p>In both cases, a password must be provided. See the designated paragraph for a detailed description of how to provide it.</p>
</div>
<div class="admonitionblock tip">
<table>
<tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
<div class="paragraph">
<p>To enable SSL support with native executables, please refer to our <a href="native-and-ssl">Using SSL With Native Executables guide</a>.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="sect2">
<h3 id="providing-a-certificate-and-key-file"><a class="anchor" href="#providing-a-certificate-and-key-file"></a>3.1. Providing a certificate and key file</h3>
<div class="paragraph">
<p>If the certificate has not been loaded into a keystore, it can be provided directly using the properties listed below.
Quarkus will first try to load the given files as resources, and uses the filesystem as a fallback.
The certificate / key pair will be loaded into a newly created keystore on startup.</p>
</div>
<div class="paragraph">
<p>Your <code>application.properties</code> would then look like this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="properties" class="language-properties hljs">quarkus.http.ssl.certificate.file=/path/to/certificate
quarkus.http.ssl.certificate.key-file=/path/to/key</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="providing-a-keystore"><a class="anchor" href="#providing-a-keystore"></a>3.2. Providing a keystore</h3>
<div class="paragraph">
<p>An alternate solution is to directly provide a keystore which already contains a default entry with a certificate
 You will need to at least provide the file and a password.</p>
</div>
<div class="paragraph">
<p>As with the certificate/key file combination, Quarkus will first try to resolve the given path as a resource, before attempting to read it from the filesystem.</p>
</div>
<div class="paragraph">
<p>Add the following property to your <code>application.properties</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">quarkus.http.ssl.certificate.key-store-file=/path/to/keystore</code></pre>
</div>
</div>
<div class="paragraph">
<p>As an optional hint, the type of keystore can be provided as one of the options listed.
If the type is not provided, Quarkus will try to deduce it from the file extensions, defaulting to type JKS.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="properties" class="language-properties hljs">quarkus.http.ssl.certificate.key-store-file-type=[one of JKS, JCEKS, P12, PKCS12, PFX]</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="setting-the-password"><a class="anchor" href="#setting-the-password"></a>3.3. Setting the password</h3>
<div class="paragraph">
<p>In both aforementioned scenarios, a password needs to be provided to create/load the keystore with.
The password can be set in your <code>application.properties</code> (in plain-text) using the following property:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="properties" class="language-properties hljs">quarkus.http.ssl.certificate.key-store-password=your-password</code></pre>
</div>
</div>
<div class="paragraph">
<p>However, instead of providing the password as plain-text in the configuration file (which is considered bad practice), it can instead be supplied (using <a href="https://microprofile.io/project/eclipse/microprofile-config">MicroProfile config</a>)
as the environment variable <code>QUARKUS_HTTP_SSL_CERTIFICATE_KEY_STORE_PASSWORD</code>.
This will also work in tandem with <a href="https://kubernetes.io/docs/concepts/configuration/secret/#using-secrets-as-environment-variables">Kubernetes secrets</a>.</p>
</div>
<div class="paragraph">
<p><em>Note: in order to remain compatible with earlier versions of Quarkus (before 0.16) the default password is set to "password". It is therefore not a mandatory parameter!</em></p>
</div>
</div>
<div class="sect2">
<h3 id="disable-the-http-port"><a class="anchor" href="#disable-the-http-port"></a>3.4. Disable the HTTP port</h3>
<div class="paragraph">
<p>It is possible to disable the HTTP port and only support secure requests. This is done via the
<code>quarkus.http.insecure-requests</code> property in <code>application.properties</code>. There are three possible
values:</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><code>enabled</code></dt>
<dd>
<p>The default, HTTP works as normal</p>
</dd>
<dt class="hdlist1"><code>redirect</code></dt>
<dd>
<p>HTTP requests will be redirected to the HTTPS port</p>
</dd>
<dt class="hdlist1"><code>disabled</code></dt>
<dd>
<p>The HTTP port will not be opened.</p>
</dd>
</dl>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
if you use <code>redirect</code> or <code>disabled</code> and have not added a SSL certificate or keystore, your server will not start!
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="http2-support"><a class="anchor" href="#http2-support"></a>4. HTTP/2 Support</h2>
<div class="sectionbody">
<div class="paragraph">
<p>HTTP/2 is enabled by default, and will be used by browsers if SSL is in use on JDK11 or higher. JDK8 does not support
ALPN so cannot be used to run HTTP/2 over SSL. Even if SSL is not in use HTTP/2 via cleartext upgrade is supported,
and may be used by non-browser clients.</p>
</div>
<div class="paragraph">
<p>If you want to disable HTTP/2 you can set:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="properties" class="language-properties hljs">quarkus.http.http2=false</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="cors-filter"><a class="anchor" href="#cors-filter"></a>5. CORS filter</h2>
<div class="sectionbody">
<div class="paragraph">
<p><a href="https://en.wikipedia.org/wiki/Cross-origin_resource_sharing">Cross-origin resource sharing</a> (CORS) is a mechanism that
allows restricted resources on a web page to be requested from another domain outside the domain from which the first resource
was served.</p>
</div>
<div class="paragraph">
<p>Quarkus comes with a CORS filter which implements the <code>javax.servlet.Filter</code> interface and intercepts all incoming HTTP
requests. It can be enabled in the Quarkus configuration file, <code>src/main/resources/application.properties</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="properties" class="language-properties hljs">quarkus.http.cors=true</code></pre>
</div>
</div>
<div class="paragraph">
<p>If the filter is enabled and an HTTP request is identified as cross-origin, the CORS policy and headers defined using the
following properties will be applied before passing the request on to its actual target (servlet, JAX-RS resource, etc.):</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Property Name</th>
<th class="tableblock halign-left valign-top">Default</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>quarkus.http.cors.origins</code></p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The comma-separated list of origins allowed for CORS. The filter allows any origin if this is not
set.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>quarkus.http.cors.methods</code></p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The comma-separated list of HTTP methods allowed for CORS. The filter allows any method if this is
not set.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>quarkus.http.cors.headers</code></p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The comma-separated list of HTTP headers allowed for CORS. The filter allows any header if this is
not set.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>quarkus.http.cors.exposed-headers</code></p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The comma-separated list of HTTP headers exposed in CORS.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>quarkus.http.cors.access-control-max-age</code></p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The duration (see note below) indicating how long the results of a pre-flight request can be cached.
This value will be returned in a <code>Access-Control-Max-Age</code> response header.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>quarkus.http.cors.access-control-allow-credentials</code></p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Boolean value to tell the browsers to expose the response to front-end JavaScript code
when the request’s credentials mode Request.credentials is “include”</p></td>
</tr>
</tbody>
</table>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="paragraph">
<p>The format for durations uses the standard <code>java.time.Duration</code> format.
You can learn more about it in the <a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html#parse-java.lang.CharSequence-">Duration#parse() javadoc</a>.</p>
</div>
<div class="paragraph">
<p>You can also provide duration values starting with a number.
In this case, if the value consists only of a number, the converter treats the value as seconds.
Otherwise, <code>PT</code> is implicitly prepended to the value to obtain a standard <code>java.time.Duration</code> format.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>Here&#8217;s what a full CORS filter configuration could look like:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="properties" class="language-properties hljs">quarkus.http.cors=true
quarkus.http.cors.origins=http://foo.com,http://www.bar.io
quarkus.http.cors.methods=GET,PUT,POST
quarkus.http.cors.headers=X-Custom
quarkus.http.cors.exposed-headers=Content-Disposition
quarkus.http.cors.access-control-max-age=24H
quarkus.http.cors.access-control-allow-credentials=true</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="http-limits-configuration"><a class="anchor" href="#http-limits-configuration"></a>6. HTTP Limits Configuration</h2>
<div class="sectionbody">
<div class="paragraph configuration-legend">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> Configuration property fixed at build time - All other configuration properties are overridable at runtime</p>
</div>
<table class="tableblock frame-all grid-all stretch configuration-reference">
<colgroup>
<col style="width: 80%;">
<col style="width: 10%;">
<col style="width: 10%;">
</colgroup>
<tbody>
<tr>
<th class="tableblock halign-left valign-top"><p class="tableblock"><a id="quarkus-vertx-http-config-group-server-limits-config_configuration"></a><a href="#quarkus-vertx-http-config-group-server-limits-config_configuration">Configuration property</a></p></th>
<th class="tableblock halign-left valign-middle"><p class="tableblock">Type</p></th>
<th class="tableblock halign-left valign-middle"><p class="tableblock">Default</p></th>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-vertx-http-config-group-server-limits-config_quarkus.http.limits.max-header-size"></a><code><a href="#quarkus-vertx-http-config-group-server-limits-config_quarkus.http.limits.max-header-size">quarkus.http.limits.max-header-size</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The maximum length of all headers.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">MemorySize  <a href="#memory-size-note-anchor" title="More information about the MemorySize format"><span class="icon"><i class="fa fa-question-circle"></i></span></a></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>20K</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-vertx-http-config-group-server-limits-config_quarkus.http.limits.max-body-size"></a><code><a href="#quarkus-vertx-http-config-group-server-limits-config_quarkus.http.limits.max-body-size">quarkus.http.limits.max-body-size</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The maximum size of a request body.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">MemorySize  <a href="#memory-size-note-anchor" title="More information about the MemorySize format"><span class="icon"><i class="fa fa-question-circle"></i></span></a></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>10240K</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-vertx-http-config-group-server-limits-config_quarkus.http.limits.max-chunk-size"></a><code><a href="#quarkus-vertx-http-config-group-server-limits-config_quarkus.http.limits.max-chunk-size">quarkus.http.limits.max-chunk-size</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The max HTTP chunk size</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">MemorySize  <a href="#memory-size-note-anchor" title="More information about the MemorySize format"><span class="icon"><i class="fa fa-question-circle"></i></span></a></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>8192</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-vertx-http-config-group-server-limits-config_quarkus.http.limits.max-initial-line-length"></a><code><a href="#quarkus-vertx-http-config-group-server-limits-config_quarkus.http.limits.max-initial-line-length">quarkus.http.limits.max-initial-line-length</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The maximum length of the initial line (e.g. <code>"GET / HTTP/1.0"</code>).</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">int</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>4096</code></p></td>
</tr>
</tbody>
</table>
<div id="memory-size-note-anchor" class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="title">About the MemorySize format</div>
<div class="paragraph">
<p>A size configuration option recognises string in this format (shown as a regular expression): <code>[0-9]+[KkMmGgTtPpEeZzYy]?</code>.
If no suffix is given, assume bytes.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="configuring-http-access-logs"><a class="anchor" href="#configuring-http-access-logs"></a>7. Configuring HTTP Access Logs</h2>
<div class="sectionbody">
<div class="paragraph">
<p>You can add HTTP request logging by configuring it in <code>application.properties</code>. There are two options for logging,
either logging to the standard JBoss logging output, or logging to a dedicated file.</p>
</div>
<div class="paragraph configuration-legend">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> Configuration property fixed at build time - All other configuration properties are overridable at runtime</p>
</div>
<table class="tableblock frame-all grid-all stretch configuration-reference">
<colgroup>
<col style="width: 80%;">
<col style="width: 10%;">
<col style="width: 10%;">
</colgroup>
<tbody>
<tr>
<th class="tableblock halign-left valign-top"><p class="tableblock"><a id="quarkus-vertx-http-config-group-access-log-config_configuration"></a><a href="#quarkus-vertx-http-config-group-access-log-config_configuration">Configuration property</a></p></th>
<th class="tableblock halign-left valign-middle"><p class="tableblock">Type</p></th>
<th class="tableblock halign-left valign-middle"><p class="tableblock">Default</p></th>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-vertx-http-config-group-access-log-config_quarkus.http.access-log.enabled"></a><code><a href="#quarkus-vertx-http-config-group-access-log-config_quarkus.http.access-log.enabled">quarkus.http.access-log.enabled</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If access logging is enabled. By default this will log via the standard logging facility</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>false</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-vertx-http-config-group-access-log-config_quarkus.http.access-log.pattern"></a><code><a href="#quarkus-vertx-http-config-group-access-log-config_quarkus.http.access-log.pattern">quarkus.http.access-log.pattern</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The access log pattern: If this is the string 'common', 'combined' or 'long' then this will use one of the specified named formats:
 -  common:
 %h %l %u %t "%r" %s %b
 -  combined:
 %h %l %u %t "%r" %s %b "%{i,Referer}" "%{i,User-Agent}"
 -  long:
 %r
 %{ALL_REQUEST_HEADERS}
   Otherwise consult the Quarkus documentation for the full list of variables that can be used.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>common</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-vertx-http-config-group-access-log-config_quarkus.http.access-log.log-to-file"></a><code><a href="#quarkus-vertx-http-config-group-access-log-config_quarkus.http.access-log.log-to-file">quarkus.http.access-log.log-to-file</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If logging should be done to a separate file.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>false</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-vertx-http-config-group-access-log-config_quarkus.http.access-log.base-file-name"></a><code><a href="#quarkus-vertx-http-config-group-access-log-config_quarkus.http.access-log.base-file-name">quarkus.http.access-log.base-file-name</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The access log file base name, defaults to 'quarkus' which will give a log file name of 'quarkus.log'.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>quarkus</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-vertx-http-config-group-access-log-config_quarkus.http.access-log.log-directory"></a><code><a href="#quarkus-vertx-http-config-group-access-log-config_quarkus.http.access-log.log-directory">quarkus.http.access-log.log-directory</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The log directory to use when logging access to a file If this is not set then the current working directory is used.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-vertx-http-config-group-access-log-config_quarkus.http.access-log.log-suffix"></a><code><a href="#quarkus-vertx-http-config-group-access-log-config_quarkus.http.access-log.log-suffix">quarkus.http.access-log.log-suffix</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The log file suffix</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>.log</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-vertx-http-config-group-access-log-config_quarkus.http.access-log.category"></a><code><a href="#quarkus-vertx-http-config-group-access-log-config_quarkus.http.access-log.category">quarkus.http.access-log.category</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The log category to use if logging is being done via the standard log mechanism (i.e. if base-file-name is empty).</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>io.quarkus.http.access-log</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><a id="quarkus-vertx-http-config-group-access-log-config_quarkus.http.access-log.rotate"></a><code><a href="#quarkus-vertx-http-config-group-access-log-config_quarkus.http.access-log.rotate">quarkus.http.access-log.rotate</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If the log should be rotated daily</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>true</code></p></td>
</tr>
</tbody>
</table>
<table class="tableblock frame-topbot grid-all stretch">
<colgroup>
<col style="width: 33.3333%;">
<col style="width: 33.3333%;">
<col style="width: 33.3334%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Attribute</th>
<th class="tableblock halign-left valign-top">Short Form</th>
<th class="tableblock halign-left valign-top">Long Form</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Remote IP address</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%a</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{REMOTE_IP}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Local IP address</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%A</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{LOCAL_IP}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Bytes sent, excluding HTTP headers, or '-' if no bytes were sent</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%b</code></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Bytes sent, excluding HTTP headers</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%B</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{BYTES_SENT}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Remote host name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%h</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{REMOTE_HOST}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Request protocol</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%H</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{PROTOCOL}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Request method</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%m</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{METHOD}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Local port</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%p</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{LOCAL_PORT}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Query string (prepended with a '?' if it exists, otherwise an empty string)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%q</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{QUERY_STRING}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">First line of the request</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%r</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{REQUEST_LINE}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">HTTP status code of the response</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%s</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{RESPONSE_CODE}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Date and time, in Common Log Format format</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%t</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{DATE_TIME}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Remote user that was authenticated</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%u</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{REMOTE_USER}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Requested URL path</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%U</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{REQUEST_URL}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Request relative path</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%R</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{RELATIVE_PATH}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Local server name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%v</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{LOCAL_SERVER_NAME}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Time taken to process the request, in millis</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%D</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{RESPONSE_TIME}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Time taken to process the request, in seconds</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%T</code></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Time taken to process the request, in micros</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{RESPONSE_TIME_MICROS}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Time taken to process the request, in nanos</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{RESPONSE_TIME_NANOS}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Current request thread name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%I</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{THREAD_NAME}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">SSL cypher</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{SSL_CIPHER}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">SSL client certificate</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{SSL_CLIENT_CERT}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">SSL session id</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{SSL_SESSION_ID}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">All request headers</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{ALL_REQUEST_HEADERS}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Cookie value</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{c,cookie_name}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Query parameter</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{q,query_param_name}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Request header</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{i,request_header_name}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Response header</p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%{o,response_header_name}</code></p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect1">
<h2 id="servlet-config"><a class="anchor" href="#servlet-config"></a>8. Servlet Config</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To use Servlet you need to explicitly include <code>quarkus-undertow</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="xml" class="language-xml hljs">&lt;dependency&gt;
  &lt;groupId&gt;io.quarkus&lt;/groupId&gt;
  &lt;artifactId&gt;quarkus-undertow&lt;/artifactId&gt;
&lt;/dependency&gt;</code></pre>
</div>
</div>
<div class="sect2">
<h3 id="undertow-handlers-conf"><a class="anchor" href="#undertow-handlers-conf"></a>8.1. undertow-handlers.conf</h3>
<div class="paragraph">
<p>You can make use of the Undertow predicate language using an <code>undertow-handlers.conf</code> file. This file should be placed
in the <code>META-INF</code> directory of your application jar. This file contains handlers defined using the
<a href="http://undertow.io/undertow-docs/undertow-docs-2.0.0/index.html#predicates-attributes-and-handlers">Undertow predicate language</a>.</p>
</div>
</div>
<div class="sect2">
<h3 id="web-xml"><a class="anchor" href="#web-xml"></a>8.2. web.xml</h3>
<div class="paragraph">
<p>If you are using a <code>web.xml</code> file as your configuration file, you can place it in the <code>src/main/resources/META-INF</code> directory.</p>
</div>
</div>
</div>
</div>
    </div>
  </div>
</div>

  </div>

  <div class="content project-footer">
  <div class="footer-section">
    <div class="logo-wrapper">
      <a href="/"><img src="/assets/images/quarkus_logo_horizontal_rgb_reverse.svg" class="project-logo" title="Quarkus"></a>
    </div>
  </div>
  <div class="grid-wrapper">
    <p class="grid__item width-3-12">Quarkus is open. All dependencies of this project are available under the <a href='https://www.apache.org/licenses/LICENSE-2.0' target='_blank'>Apache Software License 2.0</a> or compatible license.<br /><br />This website was built with <a href='https://jekyllrb.com/' target='_blank'>Jekyll</a>, is hosted on <a href='https://pages.github.com/' target='_blank'>Github Pages</a> and is completely open source. If you want to make it better, <a href='https://github.com/quarkusio/quarkusio.github.io' target='_blank'>fork the website</a> and show us what you’ve got.</p>

    
      <div class="width-1-12 project-links">
        <span>Navigation</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="/">Home</a></li>
          
            <li><a href="/guides">Guides</a></li>
          
            <li><a href="/community/#contributing">Contribute</a></li>
          
            <li><a href="/faq">FAQ</a></li>
          
            <li><a href="/get-started">Get Started</a></li>
          
        </ul>
      </div>
    
      <div class="width-1-12 project-links">
        <span>Contribute</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="https://twitter.com/quarkusio">Follow us</a></li>
          
            <li><a href="https://github.com/quarkusio">GitHub</a></li>
          
            <li><a href="/security">Security&nbsp;policy</a></li>
          
        </ul>
      </div>
    
      <div class="width-1-12 project-links">
        <span>Get Help</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="https://groups.google.com/forum/#!forum/quarkus-dev">Forums</a></li>
          
            <li><a href="https://quarkusio.zulipchat.com">Chatroom</a></li>
          
        </ul>
      </div>
    

    
      <div class="width-3-12 more-links">
        <span>Quarkus is made of community projects</span>
        <ul class="footer-links">
          
            <li><a href="https://vertx.io/" target="_blank">Eclipse Vert.x</a></li>
          
            <li><a href="https://microprofile.io" target="_blank">Eclipse MicroProfile</a></li>
          
            <li><a href="https://hibernate.org" target="_blank">Hibernate</a></li>
          
            <li><a href="https://netty.io" target="_blank">Netty</a></li>
          
            <li><a href="https://resteasy.github.io" target="_blank">RESTEasy</a></li>
          
            <li><a href="https://camel.apache.org" target="_blank">Apache Camel</a></li>
          
            <li><a href="https://code.quarkus.io/" target="_blank">And many more...</a></li>
          
        </ul>
      </div>
    
  </div>
</div>
  <div class="content redhat-footer">
  <div class="grid-wrapper">
    <span class="licence">
      <i class="fab fa-creative-commons"></i><i class="fab fa-creative-commons-by"></i> <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC by 3.0</a> | <a href="https://www.redhat.com/en/about/privacy-policy">Privacy Policy</a>
    </span>
    <span class="redhat">
      Sponsored by
    </span>
    <span class="redhat-logo">
      <a href="https://www.redhat.com/" target="_blank"><img src="/assets/images/redhat_reversed.svg"></a>
    </span>
  </div>
</div>


  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js" integrity="sha384-8gBf6Y4YYq7Jx97PIqmTwLPin4hxIzQw5aDmUg/DDhul9fFpbbLcLh3nTIIDJKhx" crossorigin="anonymous"></script>
  <script type="text/javascript" src="/assets/javascript/mobile-nav.js"></script>
  <script type="text/javascript" src="/assets/javascript/scroll-down.js"></script>
  <script src="/assets/javascript/satellite.js" type="text/javascript"></script>
  <script src="https://quarkus.io/guides/javascript/config.js" type="text/javascript"></script>
  <script src="/assets/javascript/search-filter.js" type="text/javascript"></script>
  <script src="/assets/javascript/back-to-top.js" type="text/javascript"></script>
</body>

</html>
